﻿@model ViewDataBusiness.ViewSetting
@{
    ViewBag.Title = "试图数据设置";

    ViewBag.jQuery = true;
    ViewBag.jQueryUI = true;
    ViewBag.Json = true;
    ViewBag.Global = true;

    ViewBag.Css = "/Content/ViewSetting/Site.css";
    ViewBag.Js = "/Content/ViewSetting/SettingView.js";
    
    Layout = "~/Views/_Template.cshtml";
}
<script type="text/javascript">var JsonOriginal = @Html.Raw(Model.JsonString);</script>
<table id="MainTable" cellpadding="0" cellspacing="4">
    <tr class="Disabled"><td class="PageTitle"><div class="Title">@ViewBag.Title</div></td></tr>
    <tr class="Disabled"><td class="Unit"><div class="Panel"><table cellpadding="0" cellspacing="0"><tr><td class="Name">视图文件</td><td class="Input"><input type="text" value="@ViewBag.FilePath" readonly="readonly" style="width:500px" /></td></tr></table></div><div class="Panel"><table cellpadding="0" cellspacing="0"><tr><td class="Name">视图标题</td><td class="Input"><input class="Required" name="ViewTitle" type="text" value="" title="视图标题（必填项目）" style="width:200px" /></td></tr></table></div></td></tr>
    <tr class="Disabled"><td class="ButtonUnit"><button id="ButtonSave">保存</button><button id="ButtonBack">返回</button></td></tr>
</table>
<div style="display:none" id="JsonParameterDialog" title="约定参数（请使用 Json 数据格式）">
<table id="JsonParameterTable" width="100%" cellpadding="0" cellspacing="4" style="margin-top:8px;">
    <tr><td class="Unit" style="padding:10px;"><div style="margin-bottom:5px;">约定参数</div><textarea name="JsonParameter" style="width:99%;height:250px;"></textarea></td></tr>
</table>
</div>
<div style="display:none" id="QueryDialog" title="查询定义（请使用 SqlServer 的 Sql 语法）">
<table id="QueryTable" class="DialogMianTable" cellpadding="0" cellspacing="4" width="756" style="margin-top:8px;">
    <tr><td class="Unit" style="padding:10px;"><div style="margin-bottom:5px;">操作查询语句</div><textarea name="QueryString" style="width:99%;height:80px;"></textarea></td></tr>
    <tr><td class="Unit" style="padding:10px;"><div style="margin-bottom:5px;">长度查询语句</div><textarea name="CountQuery" style="width:99%;height:40px;"></textarea></td></tr>
    <tr><td class="Unit">
        <div class="Panel">
            <table cellpadding="0" cellspacing="0"><tr><td class="Name">表名称</td><td class="Input"><input name="Tablename" type="text" value="DefaultTable" style="width:150px" /></td></tr></table>
        </div>
        <div class="Panel">
            <table cellpadding="0" cellspacing="0"><tr><td class="Name">请求类型</td><td class="Input"><select name="CommandType"><option value="1" selected="selected">查询文本</option><option value="4">存储过程</option></select></td></tr></table>
        </div>
    </td></tr>
    <tr><td class="Unit" valign="top" style="height:196px" id="Parameters"></td></tr>
</table>
</div>
<div id="OperationsHTML" style="display:none">
<div class="Panel">
    <table cellpadding="0" cellspacing="0"><tr><td class="Name">关键标识</td><td class="Input"><input name="Key" class="Select" type="text" value="" onblur="if(this.value!=''){AddOperation();}" style="width:150px" /></td></tr></table>
</div>
<div class="Panel">
    <table cellpadding="0" cellspacing="0"><tr><td class="Name">操作类别</td><td class="Input"><select name="OperationType"><option value="0" selected="selected">无值返回数据操作</option><option value="1">返回空值数据操作</option><option value="2">有值返回数据操作</option><option value="3">数据填充操作</option><option value="4">获取图片列表</option><option value="5">获取文件列表</option><option value="6">上传文件</option><option value="7">上传图片</option><option value="8">修改文件名</option><option value="9">删除文件</option><option value="10">下载文档</option><option value="11">删除图片</option><option value="12">重置缓存</option></select></td></tr></table>
</div>
<div class="Panel">
    <table cellpadding="0" cellspacing="0"><tr><td class="Name">权限名称</td><td class="Input"><input name="Permission" type="text" value="" style="width:150px" /></td></tr></table>
</div>
<div class="Panel">
    <table cellpadding="0" cellspacing="0"><tr><td class="Name">异步处理</td><td class="Input"><input name="Asynchronous" type="checkbox" /></td></tr></table>
</div>
<div class="Panel">
    <table cellpadding="0" cellspacing="0"><tr><td class="Name">查询定义</td><td class="Icon" onclick="ShowQueryDialog(this)"><input name="Query" type="hidden" /><div class="ui-state-default ui-corner-all" onmouseover="$(this).addClass('ui-state-hover');" onmouseout="$(this).removeClass('ui-state-hover');"><span class="ui-icon ui-icon-script"></span></div></td></tr></table>
</div>
<div class="Panel">
    <table cellpadding="0" cellspacing="0"><tr><td class="Name">约定参数</td><td class="Icon" onclick="ShowJsonParameterDialog(this);"><input name="JsonParameter" type="hidden" /><div class="ui-state-default ui-corner-all" onmouseover="$(this).addClass('ui-state-hover');" onmouseout="$(this).removeClass('ui-state-hover');"><span class="ui-icon ui-icon-comment"></span></div></td></tr></table>
</div>      
<div class="AIcon" style="cursor:move;">
    <div class="Icon ItemHandle"><div class="ui-state-default ui-corner-all" onmouseover="$(this).addClass('ui-state-hover');" onmouseout="$(this).removeClass('ui-state-hover');"><span class="ui-icon ui-icon-arrow-4-diag"></span></div></div>
</div>
<div class="Delete">
    <div class="Icon" onclick="DeleteOperation(this);"><div class="ui-state-default ui-corner-all" onmouseover="$(this).addClass('ui-state-hover');" onmouseout="$(this).removeClass('ui-state-hover');"><span class="ui-icon ui-icon-close"></span></div></div>
</div>  
</div>
<div id="ParametersHTML" style="display:none">
<div class="Panel">
    <table cellpadding="0" cellspacing="0"><tr><td class="Name">参数名</td><td class="Input"><input name="Name" class="Select" type="text" value="" onblur="if(this.value!=''){AddParameter();}" style="width:150px" /></td><td class="Name">参数类型</td><td class="Input"><select name="ParameterType"><option value="0" selected="selected">当前输入</option><option value="1">Post or Get 获取</option><option value="2">Post 获取</option><option value="3">Get 获取</option></select></td><td class="Name">参数值</td><td class="Input"><input name="Value" type="text" value="" style="width:150px" /></td><td><div class="Icon" onclick="DeleteParameter(this);"><div class="ui-state-default ui-corner-all" onmouseover="$(this).addClass('ui-state-hover');" onmouseout="$(this).removeClass('ui-state-hover');"><span class="ui-icon ui-icon-close"></span></div></div></td></tr></table>
</div>  
</div>
